The invention relates to a method for determining the utilization or work load of a computing apparatus, especially of a microcomputer having a real-time operating system. In the method, an idle program is always then called up when no other programs are any longer processed by the computing apparatus.
For a plurality of applications, it is often necessary to determine the utilization of a computing apparatus in real time. If, for example, the computing apparatus is a microcomputer which is accommodated in a control apparatus for an internal combustion engine and, which control apparatus, inter alia, open loop controls and/or closed loop controls the injection of fuel and/or the ignition of the fuel in the engine, then the utilization of the microcomputer is especially dependent upon the rpm of the engine. At high rpm, the microcomputer must more frequently determine the fuel mass to be injected and the ignition time point than, for example, during the idle of the engine.
The computation of the fuel mass, the ignition time point and, if needed, other operating characteristic variables of the engine, takes place in dependence upon input quantities which are measured with the aid of sensors and are supplied to the microcomputer. Especially the measurement of the input quantities takes place at specific pregiven time points or with the aid of so-called interrupts. As a rule, the microcomputer is equipped with a real-time operating system for processing such tasks.
When no computations have to be carried out by the control apparatus because of the given operating conditions of the engine, then this has the consequence that the microcomputer processes an idle program. The duration of the idle program is held as short as possible so that, as required, again one of the actual programs can be processed as quickly as possible. When none of the actual programs are pending for processing, then the idle program is called up anew.
As already mentioned, the utilization of the microcomputer is very dependent upon the engine speed (rpm) of the engine. Here, it is possible that, for a high rpm or for a plurality of pending computations, the microcomputer is no longer in a position to promptly execute all computations. Accordingly, it is possible that the microcomputer, for example, cannot compute rapidly enough the ignition time point for the ignition of the injected fuel so that this ignition time point can only then be made available by the microcomputer when the fuel already should have been ignited.
An overload of the computer of this kind therefore leads to a malfunction in the injection or ignition of the fuel in the engine. This can be prevented in that the utilization of the computing apparatus is monitored and is influenced such that an overload virtually cannot take place.
It is the object of the invention to provide a method for determining the utilization of a computing apparatus with which a monitoring of the computing apparatus can take place with the greatest possible accuracy.
This task is solved with a method of the above-mentioned kind in accordance with the invention in that the number of the call-ups of the idle program or the total duration of the idle program is determined and is evaluated after exceeding a pregiven reference time span.
The number of call-ups of the idle program during the reference time span defines a measure for the utilization of the computing apparatus. The more often the idle program is called up, the lower is the utilization of the computing apparatus. Conversely, the utilization of the computing apparatus is high when the idle program is called up only infrequently during the reference time span. A conclusion can be drawn as to the utilization of the computing apparatus from the determination of the number of call-ups of the idle program during the reference time span.
Correspondingly, it is possible to draw a conclusion as to the utilization of the computing apparatus from the total duration of the idle program during the reference time span. The longer the total duration of the idle program is, the lower is the utilization of the computing apparatus. Conversely, the utilization of the computing apparatus is high when the total duration of the idle program is short during the reference time span.
When the number of call-ups of the idle program is determined during the reference time span, then an especially advantageous configuration of the invention is that the number of call-ups of the idle program is incremented with a call-up of the idle program. The idle program itself therefore counts the number of its own call-ups. This affords the advantage that the other programs of the computing apparatus are not burdened by the method of the invention. The execution of the method according to the invention takes place during the idle program when the computing apparatus does not have to execute any other task whatsoever.
In an advantageous embodiment of the invention and after a call-up of the idle program, the latter checks whether the reference time span is exceeded. Thus, the monitoring of the reference time span is also carried out by the idle program itself. This affords the advantage that the other programs also are not loaded with reference to the above by the method of the invention. The monitoring of the reference time span can, for example, be executed by the idle program in that the actual time at the start of the reference time span is stored and thereafter, the difference between the later actual time and the stored actual time is determined.
In a further advantageous embodiment of the invention, after the reference time is exceeded, the actual number of call-ups is referred to the actual measuring time duration. When it is determined by the idle program that the reference time span is exceeded, then it is possible that the reference time span is already very significantly exceeded. If the actual number would be applied directly to the determination of the utilization of the computing apparatus, this would lead to a certain error. This is prevented in accordance with the invention in that the actual number of call-ups is first referred to the actual measurement time duration. Thus, the actual number of call-ups is considered in such a manner that a possible exceeding of the reference time span makes no difference.
In an advantageous embodiment of the invention, the actual number of call-ups is referred to a maximum possible number of call-ups after an exceeding of the reference time span. This maximum number of possible call-ups is dependent upon the reference time span and the program running time of the idle program. The program running time must be determined in advance of taking the computing apparatus into service. With the aid of the maximum possible number of call-ups in the reference time span, it is thereby possible to indicate the utilization of the computing apparatus as a relative quantity.
It is especially advantageous when, after the reference time span is exceeded, the number of call-ups is reset and the reference time span is started anew. In this way, the preconditions are provided to execute a new determination of the utilization of the computing apparatus.
The described determination according to the invention of the utilization of the computing apparatus can be utilized especially advantageously when the idle program continues to run until one of the other programs is again present for processing. In this case, the idle program is not a cyclically running program but a program which is only ended by an interrupt which is triggered by one of the other programs.
Further features, possibilities of application and advantages of the invention become evident from the following description of embodiments of the invention which are shown in the drawing. All described or illustrated features by themselves or in any desired combination define the subject matter of the invention independently of their combination in the patent claims or their dependency as well as independently of their formulation or illustration in the description or in the drawing.